package com.codeduck.kafka.kafka.properties;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * @auther Mahone Yan
 * @date 2023/5/7
 */
public enum ConsumerProperties {
    INSTANCE;
    private Properties props = new Properties();

    ConsumerProperties() {
        InputStream inputStream = ConsumerProperties.class.getClassLoader().getResourceAsStream("kafka/consumer.properties");
        try {
            props.load(inputStream);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public static Properties getProperties() {
        return ConsumerProperties.INSTANCE.props;
    }
}
